<local:UCModule x:Class="UColor.Modules.GalleryPhotoViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:UColor.WPF"
             xmlns:galleryDemo="clr-namespace:UColor.Modules.Gallery"
             xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
             xmlns:ph="clr-namespace:UColor.Modules"
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
             xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
             xmlns:coll="clr-namespace:System.Collections;assembly=mscorlib"
             xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <local:UCModule.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/UCOLOR.App;component/Themes/GalleryPhotoViewer/GalleryStyles.xaml" />
                <ResourceDictionary Source="/UCOLOR.App;component/Themes/GalleryPhotoViewer/ScrollBar.xaml" />
                <ResourceDictionary Source="/UCOLOR.App;component/Themes/GalleryPhotoViewer/ScrollViewer.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </local:UCModule.Resources>

    <local:DemoModuleControl>
        <Grid Background="Black">
            <Grid x:Name="mainView">
                <Grid.RowDefinitions>
                    <RowDefinition Height="22" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid Grid.Row="1">
                    <Border Background="Black" BorderThickness="0" CornerRadius="0,0,4,4">
                        <Border Background="#FF2F3241" BorderThickness="0" CornerRadius="0,0,3,3" Margin="1,0,1,1" />
                    </Border>
                    <Border Background="#FFD3D9FF" BorderThickness="0" Height="1" VerticalAlignment="Top" Opacity="0.3" />
                </Grid>
                <Grid x:Name="GeneralContent" Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <dxb:GalleryControl x:Name="galleryMenu" Background="Transparent" Margin="0,40,0,0" Width="150" ItemCaptionTextStyle="{StaticResource MenuGalleryItemCaptionTextStyle}">
                        <dxb:Gallery AllowFilter="False" IsGroupCaptionVisible="False" IsItemGlyphVisible="False" IsItemDescriptionVisible="False"
                                  ColCount="1" 
                                     VerticalScrollbarVisibility="Auto"
                                     ItemAutoWidth="True"
                                     ItemBorderTemplate="{StaticResource MenuGalleryItemBorderTemplate}" 
                                 ItemContentHorizontalAlignment="Left" ItemCaptionMargin="32,6,0,6" ItemClick="GalleryMenu_ItemClick">
                            <dxb:GalleryItemGroup>
                                
                            </dxb:GalleryItemGroup>
                        </dxb:Gallery>
                    </dxb:GalleryControl>

                    <dxb:GalleryControl x:Name="gallery" Grid.Column="1" GroupCaptionTextStyle="{StaticResource GalleryGroupCaptionTextStyle}"                                        
                                        Background="Transparent">
                        <dxb:Gallery AllowFilter="False" GroupCaptionVerticalAlignment="Stretch" GroupCaptionHorizontalAlignment="Stretch"
                                  ItemGlyphLocation="Top" ItemMargin="15" ItemCaptionHorizontalAlignment="Stretch" IsItemDescriptionVisible="False"
                                  IsItemGlyphVisible="False" ItemContentHorizontalAlignment="Stretch" ItemCaptionTemplate="{StaticResource GalleryItemCaptionTemplate}"
                                  GroupCaptionMargin="30,20,0,10" GroupItemsMargin="15,0,0,20" ItemClick="Gallery_ItemClick"
                                  AllowSmoothScrolling="True"
                                  GroupCaptionControlTemplate="{StaticResource GalleryGroupCaptionControlTemplate}"
                                  ItemBorderTemplate="{StaticResource GalleryItemBorderTemplate}"
                                  VerticalScrollbarVisibility="Visible"
                                  AllowToolTips="True" ToolTipTemplate="{StaticResource GalleryToolTipTemplate}" HintCaptionTemplate="{StaticResource GalleryHintCaptionTemplate}">
                            <dxb:GalleryItemGroup>

                            </dxb:GalleryItemGroup>
                        </dxb:Gallery>
                    </dxb:GalleryControl>
                </Grid>
                <Border Background="Black" CornerRadius="6,6,0,0">
                    <Border CornerRadius="5,5,0,0" Margin="1" BorderBrush="Black">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FF555864" Offset="0" />
                                <GradientStop Color="Black" Offset="1" />
                                <GradientStop Color="#FF242631" Offset="0.5" />
                                <GradientStop Color="Black" Offset="0.5" />
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </Border>
                <TextBlock HorizontalAlignment="Left" Margin="12,0,0,0" TextWrapping="Wrap" Text="" Foreground="#FFC5C8D6" VerticalAlignment="Center" />
            </Grid>
            <Border x:Name="imageViewPopup" Background="#7F000000" Visibility="Collapsed">
                <Grid>
                    <galleryDemo:ImageViewer Grid.Row="1" x:Name="imageViewer"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Visible" MouseWheelZoom="imageViewer_MouseWheelZoom" Margin="0,22,0,0" />
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="20" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="imageViewerTitle" Foreground="#FFBEC3E6" TextWrapping="Wrap" Margin="0,3" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Nature.jpg" />
                            <Button Content="btnCloseImageViewer" Grid.Column="1" HorizontalAlignment="Right" Height="8" Style="{StaticResource CloseButton}" VerticalAlignment="Center" Width="8" Click="bntCloseImageViewer_Click" Margin="0,0,10,0" />
                        </Grid>
                        <galleryDemo:ControlPanel x:Name="controlPanel" Margin="0,20,0,10" Grid.Row="2" HorizontalAlignment="Center" CommandClick="ControlPanel_CommandClick" />
                    </Grid>
                </Grid>
            </Border>
            <galleryDemo:SlideViewer x:Name="slideViewer" Visibility="Collapsed" BeforeCurrentSlideLoading="slideViewer_BeforeCurrentSlideLoading" />
        </Grid>
    </local:DemoModuleControl>
</local:UCModule>
